package com.sina.weibo;

import android.app.TabActivity;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import android.widget.Toast;
import com.sina.weibo.models.User;
import java.io.File;
import java.util.List;

public class MainTabActivity extends TabActivity implements CompoundButton.OnCheckedChangeListener
{
  public static final int MODE_AT = 5;
  public static final int MODE_CELEBRITY = 12;
  public static final int MODE_COMMENT = 4;
  public static final int MODE_FAMOUS = 8;
  public static final int MODE_FAVORITE = 5;
  public static final int MODE_GRASSROOT = 7;
  public static final int MODE_HOME = 0;
  public static final int MODE_HOTCOMMENT = 14;
  public static final int MODE_HOTFORWARD = 11;
  public static final int MODE_HOTTOPIC = 13;
  public static final String MODE_KEY = "MODE_KEY";
  public static final int MODE_LOOKAROUND = 9;
  public static final int MODE_MBLOG = 0;
  public static final int MODE_MESSAGE = 6;
  public static final int MODE_MORE = 3;
  public static final int MODE_MYBLOG = 4;
  public static final int MODE_POPULACE = 15;
  public static final int MODE_SEARCH = 2;
  public static final int MODE_TOPIC = 11;
  public static final int MODE_TOPUSER = 10;
  public static final int MODE_USER = 10;
  public static final int MODE_USERINFO = 1;
  private static final int OEM_FACTORY = 0;
  private static final int OEM_SONY_ERICSSON = 1;
  public static final int SWITCHUSER = 0;
  public static final int TOTAL_AT = 3;
  public static final int TOTAL_COMMENT = 1;
  public static final int TOTAL_MBLOG = 0;
  public static final int TOTAL_MESSAGE = 2;
  public static boolean beSwitchuser;
  private static int height;
  public static boolean mAtReload;
  public static boolean mCommentReload;
  public static boolean mFansReload;
  public static boolean mHomeReload;
  public static boolean mIsFinished;
  public static boolean mMessageReload;
  public static int mMode;
  public static boolean mPrefAutoCheck = false;
  public static boolean mPrefAutoloadMore;
  public static int mPrefInterval;
  public static boolean mPrefNotifyAt;
  public static boolean mPrefNotifyComment;
  public static boolean mPrefNotifyFans;
  public static boolean mPrefNotifyMessage;
  public static boolean mPrefNotifyNewblog;
  public static int mPrefPictureSize;
  public static boolean mPrefShowPicture;
  public static boolean mPrefVibrator;
  public static boolean mScreenOrientation;
  public static boolean mSetLookTop;
  public static boolean mSetSwitchTop;
  public static boolean mSwitchUserOnTop;
  public static boolean mTabSetup;
  public static boolean mWeiboFinish;
  private static int width;
  private String blogId = null;
  private boolean mBeBackground = false;
  private String mCacheDir;
  private TabHost mHost;
  private Intent mInfoIntent;
  private boolean mJustStart = true;
  private Intent mMBlogIntent;
  private Intent mMoreIntent;
  private RadioButton[] mRadioButtons;
  private Intent mSearchIntent;
  private int mSwitchMode = -1;
  private BroadcastReceiver mSwitchModeReceiver;
  private boolean mSwitchUser = false;
  private Intent mUserInfoIntent;
  public Vibrator mVibrator;
  private int preMode;
  private Intent serviceIntent;
  public ViewGroup vg;

  static
  {
    beSwitchuser = false;
    mMode = 0;
    mTabSetup = false;
    mSwitchUserOnTop = false;
    mHomeReload = false;
    mCommentReload = false;
    mAtReload = false;
    mMessageReload = false;
    mFansReload = false;
    mSetSwitchTop = false;
    mSetLookTop = false;
    mWeiboFinish = false;
    mIsFinished = false;
    width = 0;
    height = 0;
  }

  public MainTabActivity()
  {
    MainTabActivity.1 local1 = new MainTabActivity.1(this);
    this.mSwitchModeReceiver = local1;
    this.preMode = 0;
  }

  private void OEM_warning()
  {
    Intent localIntent = new Intent(this, SwitchUser.class);
    startActivityForResult(localIntent, 0);
  }

  public static void ReverseReloadVariant()
  {
    mHomeReload = false;
    mCommentReload = false;
    mAtReload = false;
    mMessageReload = false;
    mFansReload = false;
  }

  public static int getWindowHeight()
  {
    return height;
  }

  public static int getWindowWidth()
  {
    return width;
  }

  private void initRadios()
  {
    RadioGroup localRadioGroup = (RadioGroup)findViewById(2131624035);
    RadioButton[] arrayOfRadioButton1 = new RadioButton[5];
    this.mRadioButtons = arrayOfRadioButton1;
    int i = 0;
    while (true)
    {
      if (i >= 5)
        return;
      RadioButton[] arrayOfRadioButton2 = this.mRadioButtons;
      String str = "radio_button" + i;
      RadioButton localRadioButton = (RadioButton)localRadioGroup.findViewWithTag(str);
      arrayOfRadioButton2[i] = localRadioButton;
      this.mRadioButtons[i].setOnCheckedChangeListener(this);
      i += 1;
    }
  }

  private void load_settings()
  {
    SharedPreferences localSharedPreferences1 = PreferenceManager.getDefaultSharedPreferences(this);
    mPrefPictureSize = 240;
    mPrefAutoCheck = false;
    mPrefVibrator = localSharedPreferences1.getBoolean("vibrator", 1);
    mPrefInterval = Integer.parseInt(localSharedPreferences1.getString("interval", "180000"));
    mPrefAutoCheck = SettingsPref.isAutoRemind(this);
    mPrefAutoloadMore = localSharedPreferences1.getBoolean("autoload_more", 0);
    mPrefNotifyNewblog = localSharedPreferences1.getBoolean("notify_newblog", 0);
    mPrefNotifyComment = localSharedPreferences1.getBoolean("notify_comment", 1);
    mPrefNotifyMessage = localSharedPreferences1.getBoolean("notify_message", 1);
    mPrefNotifyAt = localSharedPreferences1.getBoolean("notify_at", 1);
    mPrefNotifyFans = localSharedPreferences1.getBoolean("notify_fans", 1);
    mScreenOrientation = localSharedPreferences1.getBoolean("screenorientation", 0);
    SharedPreferences localSharedPreferences2 = getSharedPreferences("weibo", 0);
    StaticInfo.mUsername = localSharedPreferences2.getString("username", "");
    StaticInfo.mPassword = localSharedPreferences2.getString("password", "");
  }

  private boolean login()
  {
    int i = 0;
    if ((StaticInfo.mUser != null) || (i >= 2))
    {
      if (StaticInfo.mUser == null)
        break label120;
      String str1 = this.mCacheDir;
      User localUser1 = StaticInfo.mUser;
      StaticInfo.mTotals = Utils.loadTotalFile(str1, localUser1);
      if (StaticInfo.mTotals != null)
        break label126;
      StaticInfo.mTotals = new int[12];
    }
    label120: label126: 
    do
    {
      int j = 1;
      while (true)
      {
        while (true)
        {
          return j;
          i += 1;
          try
          {
            RPCHelper localRPCHelper = RPCHelper.getInstance(getApplication());
            String str2 = StaticInfo.mUsername;
            String str3 = StaticInfo.mPassword;
            StaticInfo.mUser = localRPCHelper.login(str2, str3);
            User localUser2 = StaticInfo.mUser;
            String str4 = this.mCacheDir;
            Utils.saveUserFile(localUser2, str4, this);
          }
          catch (RPCHelper.HttpException localHttpException)
          {
            j = 0;
          }
        }
        continue;
        j = 0;
      }
    }
    while (StaticInfo.mTotals.length == 12);
    int[] arrayOfInt = new int[12];
    int k = 0;
    while (true)
    {
      int m = StaticInfo.mTotals.length;
      if (k >= m)
      {
        StaticInfo.mTotals = arrayOfInt;
        break;
      }
      int n = StaticInfo.mTotals[k];
      arrayOfInt[k] = n;
      k += 1;
    }
  }

  private void setupIntent()
  {
    this.mHost.clearAllTabs();
    Intent localIntent1 = this.mMBlogIntent;
    String str1 = this.blogId;
    Intent localIntent2 = localIntent1.putExtra("blogid", str1);
    TabHost localTabHost1 = this.mHost;
    TabHost.TabSpec localTabSpec1 = this.mHost.newTabSpec("mblog_tab");
    String str2 = getString(2131427368);
    Drawable localDrawable1 = getResources().getDrawable(2130837934);
    TabHost.TabSpec localTabSpec2 = localTabSpec1.setIndicator(str2, localDrawable1);
    Intent localIntent3 = this.mMBlogIntent;
    TabHost.TabSpec localTabSpec3 = localTabSpec2.setContent(localIntent3);
    localTabHost1.addTab(localTabSpec3);
    TabHost localTabHost2 = this.mHost;
    TabHost.TabSpec localTabSpec4 = this.mHost.newTabSpec("message_tab");
    String str3 = getString(2131427372);
    Drawable localDrawable2 = getResources().getDrawable(2130837937);
    TabHost.TabSpec localTabSpec5 = localTabSpec4.setIndicator(str3, localDrawable2);
    Intent localIntent4 = this.mInfoIntent;
    TabHost.TabSpec localTabSpec6 = localTabSpec5.setContent(localIntent4);
    localTabHost2.addTab(localTabSpec6);
    TabHost localTabHost3 = this.mHost;
    
    TabHost.TabSpec localTabSpec7 = this.mHost.newTabSpec("userinfo_tab");
    String str4 = getString(2131427449);
    Drawable localDrawable3 = getResources().getDrawable(2130837940);
    TabHost.TabSpec localTabSpec8 = localTabSpec7.setIndicator(str4, localDrawable3);
    Intent localIntent5 = this.mUserInfoIntent;
    TabHost.TabSpec localTabSpec9 = localTabSpec8.setContent(localIntent5);
    localTabHost3.addTab(localTabSpec9);
    TabHost localTabHost4 = this.mHost;
    
    TabHost.TabSpec localTabSpec10 = this.mHost.newTabSpec("search_tab");
    String str5 = getString(2131427358);
    Drawable localDrawable4 = getResources().getDrawable(2130837943);
    TabHost.TabSpec localTabSpec11 = localTabSpec10.setIndicator(str5, localDrawable4);
    Intent localIntent6 = this.mSearchIntent;
    TabHost.TabSpec localTabSpec12 = localTabSpec11.setContent(localIntent6);
    localTabHost4.addTab(localTabSpec12);
    TabHost localTabHost5 = this.mHost;
    
    TabHost.TabSpec localTabSpec13 = this.mHost.newTabSpec("more_tab");
    String str6 = getString(2131427442);
    Drawable localDrawable5 = getResources().getDrawable(2130837974);
    TabHost.TabSpec localTabSpec14 = localTabSpec13.setIndicator(str6, localDrawable5);
    Intent localIntent7 = this.mMoreIntent;
    TabHost.TabSpec localTabSpec15 = localTabSpec14.setContent(localIntent7);
    localTabHost5.addTab(localTabSpec15);
    mTabSetup = 1;
  }

  private void switchMode(int paramInt)
  {
    mMode = paramInt;
    int i = 0;
    this.mSwitchMode = -1;
    if ((mMode < 0) || (mMode > 7) || (mMode == 1))
      mMode = 0;
    switch (paramInt)
    {
    default:
    case 0:
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
    }
    while (true)
    {
      this.mRadioButtons[i].toggle();
      return;
      i = 0;
      continue;
      i = 2;
      continue;
      i = 3;
      continue;
      i = 4;
      continue;
      i = 1;
    }
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    switch (paramInt1)
    {
    default:
    case 0:
    }
    while (true)
    {
      return;
      if ((mWeiboFinish) && (mMode != 9) && (mMode != 10) && (mMode != 11))
      {
        mWeiboFinish = 0;
        finish();
      }
      if ((paramInt2 != -1) && (!mSwitchUserOnTop))
        mSetSwitchTop = 1;
      SharedPreferences localSharedPreferences = getSharedPreferences("weibo", 0);
      StaticInfo.mUsername = localSharedPreferences.getString("username", "");
      StaticInfo.mPassword = localSharedPreferences.getString("password", "");
      if ((StaticInfo.mUser == null) && (StaticInfo.mUsername.length() != 0) && (StaticInfo.mPassword.length() != 0) && (!login()))
      {
        Intent localIntent1 = new Intent(this, SwitchUser.class);
        startActivityForResult(localIntent1, 0);
        continue;
      }
      if (StaticInfo.mUser != null)
      {
        String str1 = this.mCacheDir;
        User localUser1 = StaticInfo.mUser;
        StaticInfo.mTotals = Utils.loadTotalFile(str1, localUser1);
      }
      if (StaticInfo.mTotals == null)
      {
        StaticInfo.mTotals = new int[12];
        label212: mMode = 0;
        if ((paramInt2 == -1) && (!mTabSetup))
        {
          boolean bool = login();
          String str2 = this.mCacheDir;
          User localUser2 = StaticInfo.mUser;
          mMode = Utils.loadModeFile(str2, localUser2);
          if (this.mJustStart)
          {
            this.mJustStart = 0;
            if (StaticInfo.mUser != null)
            {
              Intent localIntent2 = new Intent(this, WeiboEventService.class);
              this.serviceIntent = localIntent2;
              Intent localIntent3 = this.serviceIntent;
              String str3 = StaticInfo.mPassword;
              Intent localIntent4 = localIntent3.putExtra("password", str3);
              Intent localIntent5 = this.serviceIntent;
              String str4 = StaticInfo.mUsername;
              Intent localIntent6 = localIntent5.putExtra("username", str4);
              Intent localIntent7 = this.serviceIntent;
              ComponentName localComponentName = startService(localIntent7);
            }
            setupIntent();
          }
          this.mJustStart = 0;
        }
        if ((paramIntent != null) || (!mTabSetup))
          break label615;
        switch (mMode)
        {
        case 1:
        case 2:
        case 3:
        default:
          mMode = 0;
          mHomeReload = 1;
        case 0:
        case 4:
        case 6:
        case 5:
        }
      }
      while (true)
      {
        if ((paramInt2 == -1) && (!mSwitchUserOnTop) && (this.mSwitchUser))
        {
          this.mSwitchUser = 0;
          Toast localToast = new Toast(this);
          View localView = LayoutInflater.from(this).inflate(2130903066, null);
          localToast.setView(localView);
          localToast.setGravity(17, 0, 64536);
          localToast.setDuration(1);
          localToast.show();
        }
        int i = mMode;
        switchMode(i);
        break;
        if (StaticInfo.mTotals.length == 12)
          break label212;
        int[] arrayOfInt = new int[12];
        int j = 0;
        while (true)
        {
          int k = StaticInfo.mTotals.length;
          if (j >= k)
          {
            StaticInfo.mTotals = arrayOfInt;
            break;
          }
          int m = StaticInfo.mTotals[j];
          arrayOfInt[j] = m;
          j += 1;
        }
        mHomeReload = 1;
        continue;
        mCommentReload = 1;
        continue;
        mMessageReload = 1;
        continue;
        mAtReload = 1;
      }
      label615: if (paramIntent == null)
        continue;
      String str5 = paramIntent.getAction();
      if (str5.equals("topuser"))
      {
        Intent localIntent8 = new Intent(this, LookAroundListActivity.class);
        Intent localIntent9 = localIntent8.putExtra("mode", 10);
        startActivity(localIntent8);
        continue;
      }
      if (str5.equals("hot"))
      {
        Intent localIntent10 = new Intent(this, LookAroundListActivity.class);
        Intent localIntent11 = localIntent10.putExtra("mode", 11);
        startActivity(localIntent10);
        continue;
      }
      if (!str5.equals("lookaround"))
        continue;
      Intent localIntent12 = new Intent(this, LookAroundListActivity.class);
      Intent localIntent13 = localIntent12.putExtra("mode", 9);
      startActivity(localIntent12);
    }
  }

  public void onCheckedChanged(CompoundButton paramCompoundButton, boolean paramBoolean)
  {
    if ((paramBoolean) && (this.mHost != null))
    {
      RadioButton localRadioButton1 = this.mRadioButtons[0];
      if (paramCompoundButton != localRadioButton1)
        break label38;
      mMode = 0;
      this.mHost.setCurrentTabByTag("mblog_tab");
    }
    while (true)
    {
      return;
      label38: RadioButton localRadioButton2 = this.mRadioButtons[1];
      if (paramCompoundButton == localRadioButton2)
      {
        if ((mMode != 5) && (mMode != 4) && (mMode != 6))
          mMode = 5;
        this.mHost.setCurrentTabByTag("message_tab");
        continue;
      }
      RadioButton localRadioButton3 = this.mRadioButtons[2];
      if (paramCompoundButton == localRadioButton3)
      {
        mMode = 1;
        this.mHost.setCurrentTabByTag("userinfo_tab");
        continue;
      }
      RadioButton localRadioButton4 = this.mRadioButtons[3];
      if (paramCompoundButton == localRadioButton4)
      {
        mMode = 2;
        this.mHost.setCurrentTabByTag("search_tab");
        continue;
      }
      RadioButton localRadioButton5 = this.mRadioButtons[4];
      if (paramCompoundButton != localRadioButton5)
        continue;
      mMode = 3;
      this.mHost.setCurrentTabByTag("more_tab");
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    Display localDisplay = getWindowManager().getDefaultDisplay();
    int i = localDisplay.getWidth();
    int j = localDisplay.getHeight();
    WeiboApplication.setDisplay(i, j);
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("com.sina.weibo.action.SWITCHMODE");
    localIntentFilter.addAction("com.sina.weibo.action.SWITCHUSER");
    localIntentFilter.addAction("sina.weibo.action.SWITCHUSERDONE");
    BroadcastReceiver localBroadcastReceiver = this.mSwitchModeReceiver;
    Intent localIntent1 = registerReceiver(localBroadcastReceiver, localIntentFilter);
    mTabSetup = 0;
    mSetSwitchTop = 0;
    mIsFinished = 0;
    setContentView(2130903061);
    String str1 = getCacheDir().getPath();
    this.mCacheDir = str1;
    TabHost localTabHost = getTabHost();
    this.mHost = localTabHost;
    String str2 = getIntent().getAction();
    if ("android.intent.action.VIEW".equals(str2))
    {
      Uri localUri = getIntent().getData();
      if (localUri != null)
      {
        String str3 = localUri.getHost();
        if ("blog".equals(str3))
        {
          List localList = localUri.getPathSegments();
          String str4 = (String)localList.get(0);
          this.blogId = str4;
          StaticInfo.mUsername = (String)localList.get(1);
          StaticInfo.mPassword = (String)localList.get(2);
          mMode = 0;
          SharedPreferences.Editor localEditor1 = getSharedPreferences("weibo", 0).edit();
          String str5 = StaticInfo.mUsername;
          SharedPreferences.Editor localEditor2 = localEditor1.putString("username", str5);
          String str6 = StaticInfo.mPassword;
          SharedPreferences.Editor localEditor3 = localEditor1.putString("password", str6);
          boolean bool = localEditor1.commit();
          if (this.blogId != null)
            break label546;
          StaticInfo.mUser = Utils.loadUserFile(this.mCacheDir);
        }
      }
    }
    while (true)
    {
      StaticInfo.mUser = Utils.loadUserFile(this.mCacheDir);
      if (StaticInfo.mUser != null)
      {
        String str7 = this.mCacheDir;
        User localUser = StaticInfo.mUser;
        StaticInfo.mTotals = Utils.loadTotalFile(str7, localUser);
      }
      Intent localIntent2 = new Intent(this, HomeListActivity.class);
      this.mMBlogIntent = localIntent2;
      Intent localIntent3 = new Intent(this, SearchSquareActivity.class);
      this.mSearchIntent = localIntent3;
      Intent localIntent4 = new Intent(this, MessageGroup.class);
      this.mInfoIntent = localIntent4;
      Intent localIntent5 = new Intent(this, MyInfoActivity.class);
      this.mUserInfoIntent = localIntent5;
      Intent localIntent6 = new Intent(this, MoreItemsActivity.class);
      this.mMoreIntent = localIntent6;
      initRadios();
      return;
      SharedPreferences localSharedPreferences1 = getSharedPreferences("weibo", 0);
      StaticInfo.mUsername = localSharedPreferences1.getString("username", "");
      StaticInfo.mPassword = localSharedPreferences1.getString("password", "");
      break;
      SharedPreferences localSharedPreferences2 = getSharedPreferences("weibo", 0);
      StaticInfo.mUsername = localSharedPreferences2.getString("username", "");
      StaticInfo.mPassword = localSharedPreferences2.getString("password", "");
      break;
      label546: Utils.cleanUserFile(this.mCacheDir);
    }
  }

  protected void onDestroy()
  {
    BroadcastReceiver localBroadcastReceiver = this.mSwitchModeReceiver;
    unregisterReceiver(localBroadcastReceiver);
    super.onDestroy();
  }

  protected void onNewIntent(Intent paramIntent)
  {
    if (paramIntent.getAction() != null)
    {
      if (!paramIntent.getAction().equals("sina.weibo.action.UPDATEHOME"))
        break label30;
      mMode = 0;
      mHomeReload = 1;
    }
    while (true)
    {
      return;
      label30: if (paramIntent.getAction().equals("sina.weibo.action.UPDATECOMMENT"))
      {
        mCommentReload = 1;
        mMode = 4;
        continue;
      }
      if (paramIntent.getAction().equals("sina.weibo.action.UPDATEAT"))
      {
        mAtReload = 1;
        mMode = 5;
        continue;
      }
      if (paramIntent.getAction().equals("sina.weibo.action.UPDATEMESSAGE"))
      {
        mMessageReload = 1;
        mMode = 6;
        continue;
      }
      if (paramIntent.getAction().equals("sina.weibo.action.UPDATEFANS"))
      {
        mFansReload = 1;
        continue;
      }
      if (paramIntent.getAction().equals("com.sina.weibo.action.switchuser_activity_on_stack_top"))
      {
        mSetSwitchTop = 1;
        mMode = 0;
        continue;
      }
      if (!paramIntent.getAction().equals("com.sina.weibo.action.go_back_to_home"))
        continue;
      switchMode(0);
    }
  }

  protected void onPause()
  {
    super.onPause();
    this.mBeBackground = 1;
    if (StaticInfo.mUser != null)
    {
      int i = mMode;
      String str = this.mCacheDir;
      User localUser = StaticInfo.mUser;
      Utils.saveModeFile(i, str, localUser);
    }
    if (isFinishing())
    {
      mPrefAutoCheck = 0;
      mIsFinished = 1;
      Intent localIntent = new Intent(this, WeiboEventService.class);
      boolean bool = stopService(localIntent);
    }
  }

  protected void onResume()
  {
    load_settings();
    super.onResume();
    boolean bool;
    if ((StaticInfo.mUser == null) || (mSetSwitchTop))
      if (mSetSwitchTop)
        if (mSetSwitchTop)
        {
          bool = false;
          mSetSwitchTop = bool;
          Intent localIntent1 = new Intent(this, SwitchUser.class);
          startActivityForResult(localIntent1, 0);
        }
    while (true)
    {
      return;
      bool = true;
      break;
      bool = mSetSwitchTop;
      break;
      int i = getIntent().getIntExtra("MODE_KEY", -1);
      if (i != -1)
        this.mSwitchMode = i;
      if ((mHomeReload) || (mCommentReload) || (mMessageReload) || (mAtReload) || (mSetSwitchTop))
      {
        int j = mMode;
        switchMode(j);
      }
      if ((mFansReload) && (StaticInfo.mUser != null))
      {
        Intent localIntent2 = new Intent(this, UserWeiboAttentionFansList.class);
        String str1 = StaticInfo.mUser.uid;
        Intent localIntent3 = localIntent2.putExtra("uid", str1);
        Intent localIntent4 = localIntent2.putExtra("mode", 3);
        String str2 = StaticInfo.mUsername;
        Intent localIntent5 = localIntent2.putExtra("username", str2);
        String str3 = StaticInfo.mPassword;
        Intent localIntent6 = localIntent2.putExtra("password", str3);
        if (StaticInfo.mUser.nick != null)
        {
          String str4 = StaticInfo.mUser.nick;
          Intent localIntent7 = localIntent2.putExtra("nick", str4);
        }
        startActivity(localIntent2);
      }
      int k = -1;
      int m = mMode;
      int n = this.mSwitchMode;
      if ((m != n) && (this.mSwitchMode != -1))
        k = this.mSwitchMode;
      if (k != -1)
        switchMode(k);
      if ((this.mBeBackground) && (mTabSetup) && (StaticInfo.mUsername != null) && (StaticInfo.mUsername.length() != 0))
      {
        this.mBeBackground = 0;
        continue;
      }
      StaticInfo.mUser = Utils.loadUserFile(this.mCacheDir);
      if ((StaticInfo.mUsername.length() == 0) || (StaticInfo.mPassword.length() == 0))
      {
        Utils.setLoginStatus(0);
        if (this.mJustStart)
        {
          OEM_warning();
          continue;
        }
        if ((mMode == 10) || (mMode == 11) || (mMode == 9))
          continue;
        finish();
        continue;
      }
      if (!login())
      {
        Intent localIntent8 = new Intent(this, SwitchUser.class);
        startActivityForResult(localIntent8, 0);
        continue;
      }
      String str5 = this.mCacheDir;
      User localUser = StaticInfo.mUser;
      mMode = Utils.loadModeFile(str5, localUser);
      if (this.mJustStart)
      {
        this.mJustStart = 0;
        if (StaticInfo.mUser != null)
        {
          Intent localIntent9 = new Intent(this, WeiboEventService.class);
          this.serviceIntent = localIntent9;
          Intent localIntent10 = this.serviceIntent;
          String str6 = StaticInfo.mPassword;
          Intent localIntent11 = localIntent10.putExtra("password", str6);
          Intent localIntent12 = this.serviceIntent;
          String str7 = StaticInfo.mUsername;
          Intent localIntent13 = localIntent12.putExtra("username", str7);
          Intent localIntent14 = this.serviceIntent;
          ComponentName localComponentName = startService(localIntent14);
        }
        setupIntent();
      }
      int i1 = mMode;
      switchMode(i1);
      this.mJustStart = 0;
    }
  }
}